package com.tdkj.action.backstage.risevalue;

import java.util.List;

import javax.annotation.Resource;

import com.tdkj.action.BaseAction;
import com.tdkj.model.risevalue.BeanAuctionRule;
import com.tdkj.service.risevalue.IBeanAuctionRuleService;


public class AuctionRuleAction extends BaseAction {
    
	private IBeanAuctionRuleService auctionRuleService;
	
	private long id;
	private int hight;
	private int low;
	private int radices;
	
	private List<Long> ids;
	private List<Integer> hights;
	private List<Integer> lows;
	private List<Integer> radiceses;
	
	private String message;
	
	private List<BeanAuctionRule> auctionRules ;
	
	public String add() {
		BeanAuctionRule bean = new BeanAuctionRule();
		bean.setHight(hight);
		bean.setLow(low);
		bean.setRadices(radices);
		auctionRuleService.add(bean);
		this.setMessage("添加成功");
		return "add";
	}
	
	public String update() {
		auctionRuleService.update(ids, hights, lows, radiceses);
		this.setMessage("保存成功");
		return execute();
	}

	public String del() {
		auctionRuleService.delete(id);
		this.setMessage("删除成功");
		return "delete";
	}
	
	public String execute() {
		auctionRules = auctionRuleService.getAll();
		
		return "success";
	}
	

	@Resource
	public void setAuctionRuleService(IBeanAuctionRuleService auctionRuleService) {
		this.auctionRuleService = auctionRuleService;
	}

	/**
	 * @return the id
	 */
	public long getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(long id) {
		this.id = id;
	}

	/**
	 * @return the hight
	 */
	public int getHight() {
		return hight;
	}

	/**
	 * @param hight the hight to set
	 */
	public void setHight(int hight) {
		this.hight = hight;
	}

	/**
	 * @return the low
	 */
	public int getLow() {
		return low;
	}

	/**
	 * @param low the low to set
	 */
	public void setLow(int low) {
		this.low = low;
	}

	/**
	 * @return the radices
	 */
	public int getRadices() {
		return radices;
	}

	/**
	 * @param radices the radices to set
	 */
	public void setRadices(int radices) {
		this.radices = radices;
	}

	/**
	 * @return the auctionRules
	 */
	public List<BeanAuctionRule> getAuctionRules() {
		return auctionRules;
	}

	/**
	 * @param auctionRules the auctionRules to set
	 */
	public void setAuctionRules(List<BeanAuctionRule> auctionRules) {
		this.auctionRules = auctionRules;
	}

	/**
	 * @return the message
	 */
	public String getMessage() {
		return message;
	}

	/**
	 * @param message the message to set
	 */
	public void setMessage(String message) {
		this.message = message;
	}

	/**
	 * @return the lows
	 */
	public List<Integer> getLows() {
		return lows;
	}

	/**
	 * @param lows the lows to set
	 */
	public void setLows(List<Integer> lows) {
		this.lows = lows;
	}

	/**
	 * @return the ids
	 */
	public List<Long> getIds() {
		return ids;
	}

	/**
	 * @param ids the ids to set
	 */
	public void setIds(List<Long> ids) {
		this.ids = ids;
	}

	/**
	 * @return the hights
	 */
	public List<Integer> getHights() {
		return hights;
	}

	/**
	 * @param hights the hights to set
	 */
	public void setHights(List<Integer> hights) {
		this.hights = hights;
	}

	/**
	 * @return the radiceses
	 */
	public List<Integer> getRadiceses() {
		return radiceses;
	}

	/**
	 * @param radiceses the radiceses to set
	 */
	public void setRadiceses(List<Integer> radiceses) {
		this.radiceses = radiceses;
	} 
	
	
}
